import { request } from '@umijs/max';

const url = '/apiupload/admin/z_job';

export async function post_save_api(Req: TimedTaskApi.Dto) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/saveOrUpate`, {
    method: 'POST',
    data: Req,
  });
}

export async function get_list_api(Req: TimedTaskApi.Search) {
  return request<ResponseApi.ResUnifyFormat<ResponseApi.List<TimedTaskApi.List>>>(`${url}/findPage`, {
    method: 'POST',
    data: Req,
  });
}

export async function delete_api(ID: string) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/delete?id=${ID}`, {
    method: 'GET',
  });
}

export async function delete_batch_api(IDs: (string | number)[]) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/batchDelete`, {
    method: 'POST',
    data: IDs,
  });
}
